import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../views/Index.vue"
import HelloWorld from "../views/HelloWorld.vue"
import MapDemo1 from "@/views/MapDemo1.vue"
import MapDemo2 from "@/views/MapDemo2.vue"

Vue.use(VueRouter)

const routes = [
    {
        path: "/",
        name: "地图页面",
        component: Index,
        redirect: "/MapDemo1",
        show: true,

        children: [
            {
                path: "/MapDemo1",
                name: "MapDemo1",
                component: MapDemo1
            },
            {
                path: "/MapDemo2",
                name: "MapDemo2",
                component: MapDemo2
            },
        ],
    }, {
        path: "/tests",
        name: "参数检查",
        component: Index,
        redirect: "/HelloWorld",
        show: true,

        children: [
            {
                path: "/HelloWorld",
                name: "HelloWorld测试",
                component: HelloWorld
            },
        ],
    }
]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL || 'http://127.0.0.1:8080',
    routes
})

export default router
